From: Aquila Macedo Date: Sat, 8 Nov 2025 00:09:05 +0000 (-0300) Subject: [PATCH] MDEV-38046 Make func_regexp_pcre tolerant to PCRE2 offset change X-Git-Tag: archive/raspbian/1%11.8.5-4+rpi1^2~8 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4efa200f1ec1226b75bc80990e6a0514cd3762c9;p=mariadb.git [PATCH] MDEV-38046 Make func_regexp_pcre tolerant to PCRE2 offset change PCRE2 10.47 reports the invalid escape in 'A\q' at offset 3 instead of 2. Update the expected result and add a --replace_regex in the test so the suite passes with both older and newer PCRE2 versions. Forwarded: https://jira.mariadb.org/browse/MDEV-38046 (accepted upstream, will be in MariaDB 11.8.6+) Gbp-Pq: Name MDEV-38046-pcre2-offset.patch --- diff --git a/mysql-test/main/func_regexp_pcre.result b/mysql-test/main/func_regexp_pcre.result index 4416dfc4c..dff12c663 100644 --- a/mysql-test/main/func_regexp_pcre.result +++ b/mysql-test/main/func_regexp_pcre.result @@ -791,7 +791,7 @@ SELECT 'AB' RLIKE 'A# this is a comment\nB'; 1 SET default_regex_flags=DEFAULT; SELECT 'Aq' RLIKE 'A\\q'; -ERROR 42000: Regex error 'unrecognized character follows \ at offset 2' +ERROR 42000: Regex error 'unrecognized character follows \ at offset 3' SET default_regex_flags='EXTRA'; SELECT 'A' RLIKE 'B'; 'A' RLIKE 'B' diff --git a/mysql-test/main/func_regexp_pcre.test b/mysql-test/main/func_regexp_pcre.test index f214ee6db..260a24801 100644 --- a/mysql-test/main/func_regexp_pcre.test +++ b/mysql-test/main/func_regexp_pcre.test @@ -382,6 +382,8 @@ SELECT 'AB' RLIKE 'A B'; SELECT 'AB' RLIKE 'A# this is a comment\nB'; SET default_regex_flags=DEFAULT; +# pcre2 versions differ in the reported error offset for invalid escapes +--replace_regex /offset 2/offset 3/ --error ER_REGEXP_ERROR SELECT 'Aq' RLIKE 'A\\q';